#include "TcpServer.hpp"
#include "Dict.hpp"
#include "Command.hpp"

void Usage()
{
    std::cout << "Usage : ./server server_port" << std::endl;
    
}
// ./server  server_port
int main(int argc ,char* args[])
{
    if(argc != 2)
    {
        Usage();
        return USAGE_ERR;
    }
    InetAddr server(8080);
    Command cmd;
    std::cout << "执行到这dict" <<std::endl;
    TcpServer tsvr(server.GetPort() , [&cmd](char*word, InetAddr& client){
            return cmd.Execute(word, client);
    });
    tsvr.Init();
    tsvr.Run();
}